<?php


namespace app\admin\controller;


use think\Controller;
use think\Db;

class User extends Controller
{
    public function index()
    {
        return $this->fetch();
    }

    public function queryUser()
    {
        if($this->request->isAjax()){
            $result = Db::table('user')->where('status',5)->select();
            foreach ($result as $key){
                $data[] = [
                    'user_name' => $key['user_name'],
                    "create_time" => date('Y-m-d H:i:s',$key['create_time']),
                    'last_login_time'=>date('Y-m-d H:i:s',$key['last_login_time']),
                    'real_name' => $key['real_name'],
                    'image' => $key['image'],
                    'status' => $key['status']
                ];
            }
            return json(["code" => 0,"data"=>$data]);
        }
        return $this->fetch();
    }
}